
/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"2F7C65E1-6A77-4924-92EA-0F24AE404B47"}
 */
function guardar(event) {
	if (!descripcion)
	{
		globals.DIALOGS.showWarningDialog('Aviso','Por favor, ingrese todos los campos obligatorios','OK')
		return false
	}

	if (!databaseManager.saveData())
	{
		globals.DIALOGS.showWarningDialog('Aviso','Ocurrio un error al grabar. Inténtelo nuevamente', 'OK')
		return false
	}
	else
	{
		globals.DIALOGS.showInfoDialog('Aviso','Los datos han sido modificados','OK')
		forms.dummy.controller.show()
		globals.aplicarEstilo('hoteleria_'+estilo)
		forms.cadenas_dtl.controller.show()
		return true
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"3CB82216-0D29-41C5-BDF4-BE57FF61019E"}
 */
function cancelar(event) {
	databaseManager.revertEditedRecords()
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"D7247EF8-0F15-45DB-9359-CB41D1CDB62F"}
 */
function onShow(firstShow, event) {
	databaseManager.setAutoSave(false)
}

/**
 * Handle hide window.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"EC5CF57A-B933-4ABE-9A5E-F61BAD29C2A3"}
 */
function onHide(event) {
	databaseManager.revertEditedRecords()
	databaseManager.setAutoSave(true)
	return true
}
